package com.xfgg.cloud.domain.model.aggregate;

import com.xfgg.cloud.boot.util.JwtTokenUtil;
import com.xfgg.cloud.domain.model.entities.JwtUser;
import com.xfgg.cloud.domain.model.entities.UserInfo;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author xfgg
 */
@Data
public class User {
    private Long uid;
    private UserInfo userInfo;
    private JwtUser jwtUser;

    public String getToken() {
        return JwtTokenUtil.createToken(userInfo.getUserName(), uid.toString(), new ArrayList<>(), false);
    }
}
